// import './index.scss';
import XHeader from 'vux/src/components/x-header/index.vue'
import CONSTANT from '@/common/constants.js';
import http from '@/common/http.js';
// import Http from "../../common/http";

export default {
  name: 'Project',
  components: {
    XHeader
  },
  data () {
    return {
      index: 0,
      // 信息反馈是否有红点  为''的时候没有  为' '的时候有
      isXinxi: ' ',
      userId: '',
      item: 'item',
      textMoney: '',
      checkOK: true,
      isA: true,
      threshold: 50,
      minmovingdistance: 30,
      checked: true,
      // 项目id
      event_id: '',
      // 显示哪一个模块
      pageNo: 1,
      pageSize: 1,
      obj: {infomation: {province: ''}}
    }
  },
  mounted () {
    this.userId = window.sessionStorage.getItem('userId')
    this.event_id = window.sessionStorage.getItem('event_id')
    http.post(CONSTANT.BIUNIQUE_VIEW, {event_id: this.event_id}, (res) => {
      console.log(res)
      if (res.code == 200) {
        this.obj = res.obj
        if (this.obj.helpSex == 'man') {
          this.obj.helpSex = '男'
        } else if (this.obj.helpSex == 'woman') {
          this.obj.helpSex = '女'
        } else {
          this.obj.helpSex = ''
        }
      }
    })
  },
  methods: {
    goPayment () {
      if (this.checked == false) {
        alert('同意并接受《亲青筹用户协议》')
      } else {
        this.$router.push({path: '/payment', query: {witchOne: 'geren', money: this.obj.amount}})
        // this.$router.push({path: '/payment', query: {witchOne: 'geren', money: this.demo}})
      }
    }
  }
}
